/*
 * @Author: Suo-Yuheng syh15399227325@163.com
 * @Date: 2025-08-24 19:14:35
 * @LastEditors: Suo-Yuheng syh15399227325@163.com
 * @LastEditTime: 2025-08-24 19:43:27
 * @FilePath: /0824/mkfifo_/client.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"comm.hpp"

using namespace std;

int main()
{
    int fd = open(FIFO_FILE, O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }

    cout << "client open file done" << endl;
    
    string line;
    while(true)
    {
        cout << "Please Enter@ ";
        // cin >> line;
        getline(cin, line);

        write(fd, line.c_str(), line.size());
    }


    close(fd);
    return 0;
}